import { http } from '@/utils/http'

/**
 * 列表查询
 */
export interface listForm {
  pageNum: number
  pageSize: number
  statusList: Array<string>
  taskNumber: string
  type: string
}

/**
 * 获取寄存订单列表
 */
export const getArchiveList = (archiveForm: listForm) => {
  return http.get<any>('/deposit/archive/list-deposit', archiveForm)
}

/**
 * 获取取档订单列表
 */
export const getRetrieveList = (retrieveForm: listForm) => {
  return http.get<any>('/deposit/retrieve/list', retrieveForm)
}

/**
 * 获取归档订单列表
 */
export const getReturnList = (returnForm: listForm) => {
  return http.get<any>('/deposit/refile/list', returnForm)
}

/**
 * 获取取档订单详情
 */
export const getRetrieveDetail = (retrieveId: string) => {
  return http.get<any>(`/deposit/retrieve/${retrieveId}`)
}

/**
 * 获取寄存订单详情
 */
export const getArchiveDetail = (archiveId: string) => {
  return http.get<any>(`/deposit/archive/${archiveId}`)
}

/**
 * 获取归档订单详情
 */
export const getReturnDetail = (returnId: string) => {
  return http.get<any>(`/deposit/refile/${returnId}`)
}

/**
 * 添加寄存订单
 */
export const addArchive = (archiveAddForm: any) => {
  return http.post<any>('/deposit/archive/add', archiveAddForm)
}

/**
 * 添加取档订单
 */
export const addRetrieve = (retrieveAddForm: any) => {
  return http.post<any>('/deposit/retrieve/add', retrieveAddForm)
}

/**
 * 添加归档订单
 */
export const addReturn = (returnAddForm: any) => {
  return http.post<any>('/deposit/refile/add', returnAddForm)
}

/**
 * 完成取档任务
 */
export const completeRetrieve = (retrieveForm: any) => {
  return http.post<any>('/deposit/retrieve/finish', retrieveForm)
}

/**
 * 完成归档任务
 */
export const completeReturn = (returnForm: any) => {
  return http.post<any>('/deposit/refile/finish', returnForm)
}

/**
 * 完成寄存任务
 */
export const completeArchive = (archiveForm: any) => {
  return http.put<any>('/deposit/archive', archiveForm)
}

/**
 * 获取归档订单汇总
 */
export const getReturnSummary = () => {
  return http.get<any>(`/deposit/refile/summary`)
}

/**
 * 获取取档订单汇总
 */
export const getRetrieveSummary = () => {
  return http.get<any>(`/deposit/retrieve/summary`)
}

/**
 * 获取寄存订单汇总
 */
export const getArchiveSummary = () => {
  return http.get<any>(`/deposit/archive/deposit-summary`)
}